package com.easyJavaDemo.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class LocalDateTimeUtils {
    public final static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
    public static String format(String pattern, LocalDateTime dateTime){
        return DateTimeFormatter.ofPattern(pattern).format(dateTime);
    }
    public static LocalDateTime parse(String pattern, String dateTime){
        return LocalDateTime.parse(dateTime, DateTimeFormatter.ofPattern(pattern));
    }
}
